home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 4 #11 / Commodore_Disk_User_Vol.4_11_1991_-.d64 / further than 255 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  577b  |  18 lines

  1. 1 print"[147]this program will convert any integer"
  2. 2 print"number in base ten (denary) into the"
  3. 3 print"equivalent number in hexadecimal"
  4. 4 print"you may find it interesting that the"
  5. 5 print"only restriction concerning the value's"
  6. 6 print"magnitude is the computer's arithmetic"
  7. 7 print"abilities in denary."
  8. 8 print"so please enter any number that you"
  9. 9 print"want converted!":print:print
  10. 10 input d: z=d
  11. 20 h$=""
  12. 30 if d then a=int(d/16):h$=mid$("0123456789abcdef",1+(d-a*16),1)+h$:d=a:goto30
  13. 40 print"dec: "int(z)
  14. 50 print"hex: $"h$
  15. 60 print"press any key to run this routine again"
  16. 70 get a$: if a$="" then 70
  17. 80 run
  18.